home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / AppleEvents.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  27.7 KB  |  603 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        AppleEvents.mod
  3.  
  4.      Contains:    AppleEvent Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE AppleEvents;
  23.  
  24. IMPORT SYSTEM, Types, Memory, Quickdraw, Events, EPPC, Notification;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31. (* Apple event descriptor types *)
  32.     typeBoolean*                    = LONG("bool");
  33.     typeChar*                    = LONG("TEXT");
  34.     typeSMInt*                    = LONG("shor");
  35.     typeInteger*                    = LONG("long");
  36.     typeSMFloat*                    = LONG("sing");
  37.     typeFloat*                    = LONG("doub");
  38.     typeLongInteger*                = LONG("long");
  39.     typeShortInteger*            = LONG("shor");
  40.     typeLongFloat*                = LONG("doub");
  41.     typeShortFloat*                = LONG("sing");
  42.     typeExtended*                = LONG("exte");
  43.     typeComp*                    = LONG("comp");
  44.     typeMagnitude*                = LONG("magn");
  45.     typeAEList*                    = LONG("list");
  46.     typeAERecord*                = LONG("reco");
  47.     typeAppleEvent*                = LONG("aevt");
  48.     typeTrue*                    = LONG("true");
  49.     typeFalse*                    = LONG("fals");
  50.     typeAlias*                    = LONG("alis");
  51.     typeEnumerated*                = LONG("enum");
  52.     typeType*                    = LONG("type");
  53.     typeAppParameters*            = LONG("appa");
  54.     typeProperty*                = LONG("prop");
  55.     typeFSS*                        = LONG("fss ");
  56.     typeKeyword*                    = LONG("keyw");
  57.     typeSectionH*                = LONG("sect");
  58.     typeWildCard*                = LONG("****");
  59.     typeApplSignature*            = LONG("sign");
  60.     typeQDRectangle*                = LONG("qdrt");
  61.     typeFixed*                    = LONG("fixd");
  62.     typeSessionID*                = LONG("ssid");
  63.     typeTargetID*                = LONG("targ");
  64.     typeProcessSerialNumber*        = LONG("psn ");
  65.     typeNull*                    = LONG("null");                        (* null or nonexistent data *)
  66. (* Keywords for Apple event parameters *)
  67.     keyDirectObject*                = LONG("----");
  68.     keyErrorNumber*                = LONG("errn");
  69.     keyErrorString*                = LONG("errs");
  70.     keyProcessSerialNumber*        = LONG("psn ");
  71. (* Keywords for Apple event attributes *)
  72.     keyTransactionIDAttr*        = LONG("tran");
  73.     keyReturnIDAttr*                = LONG("rtid");
  74.     keyEventClassAttr*            = LONG("evcl");
  75.     keyEventIDAttr*                = LONG("evid");
  76.     keyAddressAttr*                = LONG("addr");
  77.     keyOptionalKeywordAttr*        = LONG("optk");
  78.     keyTimeoutAttr*                = LONG("timo");
  79.     keyInteractLevelAttr*        = LONG("inte");                        (* this attribute is read only - will be set in AESend *)
  80.     keyEventSourceAttr*            = LONG("esrc");                        (* this attribute is read only *)
  81.     keyMissedKeywordAttr*        = LONG("miss");                        (* this attribute is read only *)
  82.     keyOriginalAddressAttr*        = LONG("from");                        (* new in 1.0.1 *)
  83. (* Keywords for special handlers *)
  84.     keyPreDispatch*                = LONG("phac");                        (* preHandler accessor call *)
  85.     keySelectProc*                = LONG("selh");                        (* more selector call *)
  86. (* Keyword for recording *)
  87.     keyAERecorderCount*            = LONG("recr");                        (* available only in vers 1.0.1 and greater *)
  88. (* Keyword for version information *)
  89.     keyAEVersion*                = LONG("vers");                        (* available only in vers 1.0.1 and greater *)
  90. (* Event Class *)
  91.     kCoreEventClass*                = LONG("aevt");
  92. (* Event AIFF.ID’s *)
  93.     kAEOpenApplication*            = LONG("oapp");
  94.     kAEOpenDocuments*            = LONG("odoc");
  95.     kAEPrintDocuments*            = LONG("pdoc");
  96.     kAEQuitApplication*            = LONG("quit");
  97.     kAEAnswer*                    = LONG("ansr");
  98.     kAEApplicationDied*            = LONG("obit");
  99.  
  100. (* Constants for use in AESend mode *)
  101.     kAENoReply*                    = $00000001;                    (* sender doesn't want a reply to event *)
  102.     kAEQueueReply*                = $00000002;                    (* sender wants a reply but won't wait *)
  103.     kAEWaitReply*                = $00000003;                    (* sender wants a reply and will wait *)
  104.     kAENeverInteract*            = $00000010;                    (* server should not interact with user *)
  105.     kAECanInteract*                = $00000020;                    (* server may try to interact with user *)
  106.     kAEAlwaysInteract*            = $00000030;                    (* server should always interact with user where appropriate *)
  107.     kAECanSwitchLayer*            = $00000040;                    (* interaction may switch layer *)
  108.     kAEDontReconnect*            = $00000080;                    (* don't reconnect if there is a sessClosedErr from PPCToolbox *)
  109.     kAEWantReceipt*                = EPPC.nReturnReceipt;                (* sender wants a receipt of message *)
  110.     kAEDontRecord*                = $00001000;                    (* don't record this event - available only in vers 1.0.1 and greater *)
  111.     kAEDontExecute*                = $00002000;                    (* don't send the event for recording - available only in vers 1.0.1 and greater *)
  112. (* Constants for the send priority in AESend *)
  113.     kAENormalPriority*            = $00000000;                    (* post message at the end of the event queue *)
  114.     kAEHighPriority*                = EPPC.nAttnMsg;                        (* post message at the front of the event queue *)
  115.  
  116. (* Constants for recording *)
  117.     kAEStartRecording*            = LONG("reca");                        (* available only in vers 1.0.1 and greater *)
  118.     kAEStopRecording*            = LONG("recc");                        (* available only in vers 1.0.1 and greater *)
  119.     kAENotifyStartRecording*        = LONG("rec1");                        (* available only in vers 1.0.1 and greater *)
  120.     kAENotifyStopRecording*        = LONG("rec0");                        (* available only in vers 1.0.1 and greater *)
  121.     kAENotifyRecording*            = LONG("recr");
  122.  
  123. (* Constant for the returnID param of AECreateAppleEvent *)
  124.     kAutoGenerateReturnID*        = -1;                            (* AECreateAppleEvent will generate a session-unique AIFF.ID *)
  125. (* Constant for transaction AIFF.ID’s *)
  126.     kAnyTransactionID*            = 0;                            (* no transaction is in use *)
  127. (* Constants for timeout durations *)
  128.     kAEDefaultTimeout*            = -1;                            (* timeout value determined by AEM *)
  129.     kNoTimeOut*                    = -2;                            (* wait until reply comes back, however long it takes *)
  130.  
  131. (* Constants for AEResumeTheCurrentEvent *)
  132.     kAENoDispatch*                = 0;                            (* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch *)
  133.     kAEUseStandardDispatch*        = $FFFFFFFF;                    (* table, or one of these two constants *)
  134. (* Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch *)
  135.     kAEDoNotIgnoreHandler*        = $00000000;
  136.     kAEIgnoreAppPhacHandler*        = $00000001;                    (* available only in vers 1.0.1 and greater *)
  137.     kAEIgnoreAppEventHandler*    = $00000002;                    (* available only in vers 1.0.1 and greater *)
  138.     kAEIgnoreSysPhacHandler*        = $00000004;                    (* available only in vers 1.0.1 and greater *)
  139.     kAEIgnoreSysEventHandler*    = $00000008;                    (* available only in vers 1.0.1 and greater *)
  140.     kAEIngoreBuiltInEventHandler* = $00000010;                    (* available only in vers 1.0.1 and greater *)
  141.     kAEDontDisposeOnResume*        = $80000000;                    (* available only in vers 1.0.1 and greater *)
  142.  
  143. (* Apple event manager data types *)
  144.     
  145. TYPE
  146.     AEEventClass* = Types.FourCharCode;
  147.  
  148.     AEEventID* = Types.FourCharCode;
  149.  
  150.     AEKeyword* = Types.FourCharCode;
  151.  
  152.     DescType* = Types.ResType;
  153.  
  154.     AEDesc* = RECORD
  155.         descriptorType*:            DescType;
  156.         dataHandle*:                Types.Handle;
  157.     END;
  158.  
  159.     AEKeyDesc* = RECORD
  160.         descKey*:                AEKeyword;
  161.         descContent*:            AEDesc;
  162.     END;
  163.  
  164. (* an AEDesc which contains address data *)
  165.     AEAddressDesc* = AEDesc;
  166.  
  167. (* a list of AEDesc's is a special kind of AEDesc *)
  168.     AEDescList* = AEDesc;
  169.  
  170. (* AERecord is a list of keyworded AEDesc's *)
  171.     AERecord* = AEDescList;
  172.  
  173. (* an AERecord that contains an AppleEvent *)
  174.     AppleEvent* = AERecord;
  175.  
  176. (* parameter to AESend *)
  177.     AESendMode* = LONGINT;
  178.  
  179. (* priority param of AESend *)
  180.     AESendPriority* = INTEGER;
  181.  
  182.  
  183. CONST
  184.     kAEInteractWithSelf*            = 0;
  185.     kAEInteractWithLocal*        = 1;
  186.     kAEInteractWithAll*            = 2;
  187.  
  188.     
  189. TYPE
  190.     AEInteractAllowed* = Types.SInt8;
  191.  
  192.  
  193. CONST
  194.     kAEUnknownSource*            = 0;
  195.     kAEDirectCall*                = 1;
  196.     kAESameProcess*                = 2;
  197.     kAELocalProcess*                = 3;
  198.     kAERemoteProcess*            = 4;
  199.  
  200.     
  201. TYPE
  202.     AEEventSource* = Types.SInt8;
  203.  
  204.  
  205. CONST
  206.     kAEDataArray*                = 0;
  207.     kAEPackedArray*                = 1;
  208.     kAEHandleArray*                = 2;
  209.     kAEDescArray*                = 3;
  210.     kAEKeyDescArray*                = 4;
  211.  
  212.     
  213. TYPE
  214.     AEArrayType* = Types.SInt8;
  215.  
  216.     AEArrayData* = RECORD
  217.         (*ΔΔ CASE INTEGER OF
  218.         0: (
  219.             kAEDataArray*:                ARRAY [0..0] OF INTEGER;
  220.            );
  221.         1: (
  222.             kAEPackedArray*:                PACKED ARRAY [0..0] OF CHAR;
  223.            );
  224.         2: (
  225.             kAEHandleArray*:                ARRAY [0..0] OF Types.Handle;
  226.            );
  227.         3: (
  228.             kAEDescArray*:                ARRAY [0..0] OF AEDesc;
  229.            );
  230.         4: (
  231.             kAEKeyDescArray*:            ARRAY [0..0] OF AEKeyDesc;
  232.            );*)
  233.     END;
  234.  
  235.     AEArrayDataPointer* = POINTER TO AEArrayData;
  236.  
  237.     AEIdleProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR theEvent: Events.EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: Quickdraw.RgnHandle): BOOLEAN;
  238.     AEFilterProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR theEvent: Events.EventRecord; returnID: LONGINT; transactionID: LONGINT; (*CONST*)VAR sender: AEAddressDesc): BOOLEAN;
  239.     AEEventHandlerProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE ((*CONST*)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT): Types.OSErr;
  240.     AECoerceDescProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE ((*CONST*)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): Types.OSErr;
  241.     AECoercePtrProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): Types.OSErr;
  242.     AEIdleUPP* = Types.UniversalProcPtr;
  243.     AEFilterUPP* = Types.UniversalProcPtr;
  244.     AEEventHandlerUPP* = Types.UniversalProcPtr;
  245.     AECoerceDescUPP* = Types.UniversalProcPtr;
  246.     AECoercePtrUPP* = Types.UniversalProcPtr;
  247.  
  248. CONST
  249.     uppAEIdleProcInfo* = $00000FD0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param): 1 byte result; *)
  250.     uppAEFilterProcInfo* = $00003FD0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; *)
  251.     uppAEEventHandlerProcInfo* = $00000FE0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  252.     uppAECoerceDescProcInfo* = $00003FE0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  253.     uppAECoercePtrProcInfo* = $0003FFE0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  254.  
  255. PROCEDURE NewAEIdleProc*(userRoutine: AEIdleProcPtr): AEIdleUPP;
  256.     (*$IF NOT GENERATINGCFM *)
  257.     INLINE PASCAL $2E9F;
  258.     (*$END*)
  259.  
  260. PROCEDURE NewAEFilterProc*(userRoutine: AEFilterProcPtr): AEFilterUPP;
  261.     (*$IF NOT GENERATINGCFM *)
  262.     INLINE PASCAL $2E9F;
  263.     (*$END*)
  264.  
  265. PROCEDURE NewAEEventHandlerProc*(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP;
  266.     (*$IF NOT GENERATINGCFM *)
  267.     INLINE PASCAL $2E9F;
  268.     (*$END*)
  269.  
  270. PROCEDURE NewAECoerceDescProc*(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP;
  271.     (*$IF NOT GENERATINGCFM *)
  272.     INLINE PASCAL $2E9F;
  273.     (*$END*)
  274.  
  275. PROCEDURE NewAECoercePtrProc*(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP;
  276.     (*$IF NOT GENERATINGCFM *)
  277.     INLINE PASCAL $2E9F;
  278.     (*$END*)
  279.  
  280. PROCEDURE CallAEIdleProc*(VAR theEvent: Events.EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: Quickdraw.RgnHandle; userRoutine: AEIdleUPP): BOOLEAN;
  281.     (*$IF NOT GENERATINGCFM*)
  282.     INLINE PASCAL $205F, $4E90;
  283.     (*$END*)
  284.  
  285. PROCEDURE CallAEFilterProc*(VAR theEvent: Events.EventRecord; returnID: LONGINT; transactionID: LONGINT; (*CONST*)VAR sender: AEAddressDesc; userRoutine: AEFilterUPP): BOOLEAN;
  286.     (*$IF NOT GENERATINGCFM*)
  287.     INLINE PASCAL $205F, $4E90;
  288.     (*$END*)
  289.  
  290. PROCEDURE CallAEEventHandlerProc*((*CONST*)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT; userRoutine: AEEventHandlerUPP): Types.OSErr;
  291.     (*$IF NOT GENERATINGCFM*)
  292.     INLINE PASCAL $205F, $4E90;
  293.     (*$END*)
  294.  
  295. PROCEDURE CallAECoerceDescProc*((*CONST*)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc; userRoutine: AECoerceDescUPP): Types.OSErr;
  296.     (*$IF NOT GENERATINGCFM*)
  297.     INLINE PASCAL $205F, $4E90;
  298.     (*$END*)
  299.  
  300. PROCEDURE CallAECoercePtrProc*(typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc; userRoutine: AECoercePtrUPP): Types.OSErr;
  301.     (*$IF NOT GENERATINGCFM*)
  302.     INLINE PASCAL $205F, $4E90;
  303.     (*$END*)
  304.     
  305. TYPE
  306.     AECoercionHandlerUPP* = Types.UniversalProcPtr;
  307.  
  308. (**************************************************************************
  309.  The following calls apply to any AEDesc. Every 'result' descriptor is
  310.  created for you, so you will be responsible for memory management
  311.  (including disposing) of the descriptors so created. Note: purgeable
  312.  descriptor data is not supported - the AEM does not call LoadResource.  
  313. **************************************************************************)
  314.  
  315. PROCEDURE AECreateDesc*(typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size; VAR result: AEDesc): Types.OSErr;
  316.     (*$IF NOT GENERATINGCFM*)
  317.     INLINE PASCAL $303C, $0825, $A816;
  318.     (*$END*)
  319. PROCEDURE AECoercePtr*(typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size; toType: DescType; VAR result: AEDesc): Types.OSErr;
  320.     (*$IF NOT GENERATINGCFM*)
  321.     INLINE PASCAL $303C, $0A02, $A816;
  322.     (*$END*)
  323. PROCEDURE AECoerceDesc*((*CONST*)VAR theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): Types.OSErr;
  324.     (*$IF NOT GENERATINGCFM*)
  325.     INLINE PASCAL $303C, $0603, $A816;
  326.     (*$END*)
  327. PROCEDURE AEDisposeDesc*(VAR theAEDesc: AEDesc): Types.OSErr;
  328.     (*$IF NOT GENERATINGCFM*)
  329.     INLINE PASCAL $303C, $0204, $A816;
  330.     (*$END*)
  331. PROCEDURE AEDuplicateDesc*((*CONST*)VAR theAEDesc: AEDesc; VAR result: AEDesc): Types.OSErr;
  332.     (*$IF NOT GENERATINGCFM*)
  333.     INLINE PASCAL $303C, $0405, $A816;
  334.     (*$END*)
  335. (**************************************************************************
  336.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  337.   AEDesc, the calls in the previous section can also be used for AEDescList.
  338.   All list and array indices are 1-based. If the data was greater than
  339.   maximumSize in the routines below, then actualSize will be greater than
  340.   maximumSize, but only maximumSize bytes will actually be retrieved.
  341. **************************************************************************)
  342. PROCEDURE AECreateList*(factoringPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; factoredSize: Memory.Size; isRecord: BOOLEAN; VAR resultList: AEDescList): Types.OSErr;
  343.     (*$IF NOT GENERATINGCFM*)
  344.     INLINE PASCAL $303C, $0706, $A816;
  345.     (*$END*)
  346. PROCEDURE AECountItems*((*CONST*)VAR theAEDescList: AEDescList; VAR theCount: LONGINT): Types.OSErr;
  347.     (*$IF NOT GENERATINGCFM*)
  348.     INLINE PASCAL $303C, $0407, $A816;
  349.     (*$END*)
  350. PROCEDURE AEPutPtr*(VAR theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size): Types.OSErr;
  351.     (*$IF NOT GENERATINGCFM*)
  352.     INLINE PASCAL $303C, $0A08, $A816;
  353.     (*$END*)
  354. PROCEDURE AEPutDesc*(VAR theAEDescList: AEDescList; index: LONGINT; (*CONST*)VAR theAEDesc: AEDesc): Types.OSErr;
  355.     (*$IF NOT GENERATINGCFM*)
  356.     INLINE PASCAL $303C, $0609, $A816;
  357.     (*$END*)
  358. PROCEDURE AEGetNthPtr*((*CONST*)VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; maximumSize: Memory.Size; VAR actualSize: Memory.Size): Types.OSErr;
  359.     (*$IF NOT GENERATINGCFM*)
  360.     INLINE PASCAL $303C, $100A, $A816;
  361.     (*$END*)
  362. PROCEDURE AEGetNthDesc*((*CONST*)VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): Types.OSErr;
  363.     (*$IF NOT GENERATINGCFM*)
  364.     INLINE PASCAL $303C, $0A0B, $A816;
  365.     (*$END*)
  366. PROCEDURE AESizeOfNthItem*((*CONST*)VAR theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Memory.Size): Types.OSErr;
  367.     (*$IF NOT GENERATINGCFM*)
  368.     INLINE PASCAL $303C, $082A, $A816;
  369.     (*$END*)
  370. PROCEDURE AEGetArray*((*CONST*)VAR theAEDescList: AEDescList; arrayType: Types.ByteParameter; arrayPtr: AEArrayDataPointer; maximumSize: Memory.Size; VAR itemType: DescType; VAR itemSize: Memory.Size; VAR itemCount: LONGINT): Types.OSErr;
  371.     (*$IF NOT GENERATINGCFM*)
  372.     INLINE PASCAL $303C, $0D0C, $A816;
  373.     (*$END*)
  374. PROCEDURE AEPutArray*(VAR theAEDescList: AEDescList; arrayType: Types.ByteParameter; (*CONST*)VAR arrayPtr: AEArrayData; itemType: DescType; itemSize: Memory.Size; itemCount: LONGINT): Types.OSErr;
  375.     (*$IF NOT GENERATINGCFM*)
  376.     INLINE PASCAL $303C, $0B0D, $A816;
  377.     (*$END*)
  378. PROCEDURE AEDeleteItem*(VAR theAEDescList: AEDescList; index: LONGINT): Types.OSErr;
  379.     (*$IF NOT GENERATINGCFM*)
  380.     INLINE PASCAL $303C, $040E, $A816;
  381.     (*$END*)
  382. (**************************************************************************
  383.  The following calls apply to AERecord. Since AERecord is a subtype of
  384.  AEDescList, the calls in the previous sections can also be used for
  385.  AERecord an AERecord can be created by using AECreateList with isRecord
  386.  set to true. 
  387. **************************************************************************)
  388. PROCEDURE AEPutKeyPtr*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size): Types.OSErr;
  389.     (*$IF NOT GENERATINGCFM*)
  390.     INLINE PASCAL $303C, $0A0F, $A816;
  391.     (*$END*)
  392. PROCEDURE AEPutKeyDesc*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; (*CONST*)VAR theAEDesc: AEDesc): Types.OSErr;
  393.     (*$IF NOT GENERATINGCFM*)
  394.     INLINE PASCAL $303C, $0610, $A816;
  395.     (*$END*)
  396. PROCEDURE AEGetKeyPtr*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; maximumSize: Memory.Size; VAR actualSize: Memory.Size): Types.OSErr;
  397.     (*$IF NOT GENERATINGCFM*)
  398.     INLINE PASCAL $303C, $0E11, $A816;
  399.     (*$END*)
  400. PROCEDURE AEGetKeyDesc*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): Types.OSErr;
  401.     (*$IF NOT GENERATINGCFM*)
  402.     INLINE PASCAL $303C, $0812, $A816;
  403.     (*$END*)
  404. PROCEDURE AESizeOfKeyDesc*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Memory.Size): Types.OSErr;
  405.     (*$IF NOT GENERATINGCFM*)
  406.     INLINE PASCAL $303C, $0829, $A816;
  407.     (*$END*)
  408. PROCEDURE AEDeleteKeyDesc*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): Types.OSErr;
  409.     (*$IF NOT GENERATINGCFM*)
  410.     INLINE PASCAL $303C, $0413, $A816;
  411.     (*$END*)
  412. PROCEDURE AEPutParamPtr*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size): Types.OSErr;
  413.     (*$IF NOT GENERATINGCFM*)
  414.     INLINE PASCAL $303C, $0A0F, $A816;
  415.     (*$END*)
  416. PROCEDURE AEPutParamDesc*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; (*CONST*)VAR theAEDesc: AEDesc): Types.OSErr;
  417.     (*$IF NOT GENERATINGCFM*)
  418.     INLINE PASCAL $303C, $0610, $A816;
  419.     (*$END*)
  420. PROCEDURE AEGetParamPtr*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; maximumSize: Memory.Size; VAR actualSize: Memory.Size): Types.OSErr;
  421.     (*$IF NOT GENERATINGCFM*)
  422.     INLINE PASCAL $303C, $0E11, $A816;
  423.     (*$END*)
  424. PROCEDURE AEGetParamDesc*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): Types.OSErr;
  425.     (*$IF NOT GENERATINGCFM*)
  426.     INLINE PASCAL $303C, $0812, $A816;
  427.     (*$END*)
  428. PROCEDURE AESizeOfParam*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Memory.Size): Types.OSErr;
  429.     (*$IF NOT GENERATINGCFM*)
  430.     INLINE PASCAL $303C, $0829, $A816;
  431.     (*$END*)
  432. PROCEDURE AEDeleteParam*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): Types.OSErr;
  433.     (*$IF NOT GENERATINGCFM*)
  434.     INLINE PASCAL $303C, $0413, $A816;
  435.     (*$END*)
  436. (**************************************************************************
  437.  The following calls also apply to type AppleEvent. Message attributes are
  438.  far more restricted, and can only be accessed through the following 5
  439.  calls. The various list and record routines cannot be used to access the
  440.  attributes of an event. 
  441. **************************************************************************)
  442. PROCEDURE AEGetAttributePtr*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; maximumSize: Memory.Size; VAR actualSize: Memory.Size): Types.OSErr;
  443.     (*$IF NOT GENERATINGCFM*)
  444.     INLINE PASCAL $303C, $0E15, $A816;
  445.     (*$END*)
  446. PROCEDURE AEGetAttributeDesc*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): Types.OSErr;
  447.     (*$IF NOT GENERATINGCFM*)
  448.     INLINE PASCAL $303C, $0826, $A816;
  449.     (*$END*)
  450. PROCEDURE AESizeOfAttribute*((*CONST*)VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Memory.Size): Types.OSErr;
  451.     (*$IF NOT GENERATINGCFM*)
  452.     INLINE PASCAL $303C, $0828, $A816;
  453.     (*$END*)
  454. PROCEDURE AEPutAttributePtr*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataSize: Memory.Size): Types.OSErr;
  455.     (*$IF NOT GENERATINGCFM*)
  456.     INLINE PASCAL $303C, $0A16, $A816;
  457.     (*$END*)
  458. PROCEDURE AEPutAttributeDesc*(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; (*CONST*)VAR theAEDesc: AEDesc): Types.OSErr;
  459.     (*$IF NOT GENERATINGCFM*)
  460.     INLINE PASCAL $303C, $0627, $A816;
  461.     (*$END*)
  462. (**************************************************************************
  463.   The next couple of calls are basic routines used to create, send,
  464.   and process  
  465. **************************************************************************)
  466. PROCEDURE AECreateAppleEvent*(theAEEventClass: AEEventClass; theAEEventID: AEEventID; (*CONST*)VAR target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; VAR result: AppleEvent): Types.OSErr;
  467.     (*$IF NOT GENERATINGCFM*)
  468.     INLINE PASCAL $303C, $0B14, $A816;
  469.     (*$END*)
  470. PROCEDURE AESend*((*CONST*)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: AEIdleUPP; filterProc: AEFilterUPP): Types.OSErr;
  471.     (*$IF NOT GENERATINGCFM*)
  472.     INLINE PASCAL $303C, $0D17, $A816;
  473.     (*$END*)
  474. PROCEDURE AEProcessAppleEvent*((*CONST*)VAR theEventRecord: Events.EventRecord): Types.OSErr;
  475.     (*$IF NOT GENERATINGCFM*)
  476.     INLINE PASCAL $303C, $021B, $A816;
  477.     (*$END*)
  478. (* 
  479.  Note: during event processing, an event handler may realize that it is likely
  480.  to exceed the client's timeout limit. Passing the reply to this
  481.  routine causes a wait event to be generated that asks the client
  482.  for more time. 
  483. *)
  484. PROCEDURE AEResetTimer*((*CONST*)VAR reply: AppleEvent): Types.OSErr;
  485.     (*$IF NOT GENERATINGCFM*)
  486.     INLINE PASCAL $303C, $0219, $A816;
  487.     (*$END*)
  488. (**************************************************************************
  489.  The following four calls are available for applications which need more
  490.  sophisticated control over when and how events are processed. Applications
  491.  which implement multi-session servers or which implement their own
  492.  internal event queueing will probably be the major clients of these
  493.  routines. They can be called from within a handler to prevent the AEM from
  494.  disposing of the AppleEvent when the handler returns. They can be used to
  495.  asynchronously process the event (as MacApp does).
  496. **************************************************************************)
  497. PROCEDURE AESuspendTheCurrentEvent*((*CONST*)VAR theAppleEvent: AppleEvent): Types.OSErr;
  498.     (*$IF NOT GENERATINGCFM*)
  499.     INLINE PASCAL $303C, $022B, $A816;
  500.     (*$END*)
  501. (* 
  502.  Note: The following routine tells the AppleEvent manager that processing
  503.  is either about to resume or has been completed on a previously suspended
  504.  event. The procPtr passed in as the dispatcher parameter will be called to
  505.  attempt to redispatch the event. Several constants for the dispatcher
  506.  parameter allow special behavior. They are:
  507.       - kAEUseStandardDispatch means redispatch as if the event was just
  508.       received, using the standard AppleEvent dispatch mechanism.
  509.       - kAENoDispatch means ignore the parameter.
  510.          Use this in the case where the event has been handled and no
  511.       redispatch is needed.
  512.       - non nil means call the routine which the dispatcher points to.
  513. *)
  514. PROCEDURE AEResumeTheCurrentEvent*((*CONST*)VAR theAppleEvent: AppleEvent; (*CONST*)VAR reply: AppleEvent; dispatcher: AEEventHandlerUPP; handlerRefcon: LONGINT): Types.OSErr;
  515.     (*$IF NOT GENERATINGCFM*)
  516.     INLINE PASCAL $303C, $0818, $A816;
  517.     (*$END*)
  518. PROCEDURE AEGetTheCurrentEvent*(VAR theAppleEvent: AppleEvent): Types.OSErr;
  519.     (*$IF NOT GENERATINGCFM*)
  520.     INLINE PASCAL $303C, $021A, $A816;
  521.     (*$END*)
  522. PROCEDURE AESetTheCurrentEvent*((*CONST*)VAR theAppleEvent: AppleEvent): Types.OSErr;
  523.     (*$IF NOT GENERATINGCFM*)
  524.     INLINE PASCAL $303C, $022C, $A816;
  525.     (*$END*)
  526. (**************************************************************************
  527.   The following three calls are used to allow applications to behave
  528.   courteously when a user interaction such as a dialog box is needed. 
  529. **************************************************************************)
  530. PROCEDURE AEGetInteractionAllowed*(VAR level: AEInteractAllowed): Types.OSErr;
  531.     (*$IF NOT GENERATINGCFM*)
  532.     INLINE PASCAL $303C, $021D, $A816;
  533.     (*$END*)
  534. PROCEDURE AESetInteractionAllowed*(level: Types.ByteParameter): Types.OSErr;
  535.     (*$IF NOT GENERATINGCFM*)
  536.     INLINE PASCAL $303C, $011E, $A816;
  537.     (*$END*)
  538. PROCEDURE AEInteractWithUser*(timeOutInTicks: LONGINT; nmReqPtr: Notification.NMRecPtr; idleProc: AEIdleUPP): Types.OSErr;
  539.     (*$IF NOT GENERATINGCFM*)
  540.     INLINE PASCAL $303C, $061C, $A816;
  541.     (*$END*)
  542. (**************************************************************************
  543.   These calls are used to set up and modify the event dispatch table.
  544. **************************************************************************)
  545. PROCEDURE AEInstallEventHandler*(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): Types.OSErr;
  546.     (*$IF NOT GENERATINGCFM*)
  547.     INLINE PASCAL $303C, $091F, $A816;
  548.     (*$END*)
  549. PROCEDURE AERemoveEventHandler*(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: BOOLEAN): Types.OSErr;
  550.     (*$IF NOT GENERATINGCFM*)
  551.     INLINE PASCAL $303C, $0720, $A816;
  552.     (*$END*)
  553. PROCEDURE AEGetEventHandler*(theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: AEEventHandlerUPP; VAR handlerRefcon: LONGINT; isSysHandler: BOOLEAN): Types.OSErr;
  554.     (*$IF NOT GENERATINGCFM*)
  555.     INLINE PASCAL $303C, $0921, $A816;
  556.     (*$END*)
  557. (**************************************************************************
  558.   These calls are used to set up and modify the coercion dispatch table.
  559. **************************************************************************)
  560. PROCEDURE AEInstallCoercionHandler*(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): Types.OSErr;
  561.     (*$IF NOT GENERATINGCFM*)
  562.     INLINE PASCAL $303C, $0A22, $A816;
  563.     (*$END*)
  564. PROCEDURE AERemoveCoercionHandler*(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: BOOLEAN): Types.OSErr;
  565.     (*$IF NOT GENERATINGCFM*)
  566.     INLINE PASCAL $303C, $0723, $A816;
  567.     (*$END*)
  568. PROCEDURE AEGetCoercionHandler*(fromType: DescType; toType: DescType; VAR handler: AECoercionHandlerUPP; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): Types.OSErr;
  569.     (*$IF NOT GENERATINGCFM*)
  570.     INLINE PASCAL $303C, $0B24, $A816;
  571.     (*$END*)
  572. (**************************************************************************
  573.   These calls are used to set up and modify special hooks into the
  574.   AppleEvent manager.
  575. **************************************************************************)
  576. PROCEDURE AEInstallSpecialHandler*(functionClass: AEKeyword; handler: Types.UniversalProcPtr; isSysHandler: BOOLEAN): Types.OSErr;
  577.     (*$IF NOT GENERATINGCFM*)
  578.     INLINE PASCAL $303C, $0500, $A816;
  579.     (*$END*)
  580. PROCEDURE AERemoveSpecialHandler*(functionClass: AEKeyword; handler: Types.UniversalProcPtr; isSysHandler: BOOLEAN): Types.OSErr;
  581.     (*$IF NOT GENERATINGCFM*)
  582.     INLINE PASCAL $303C, $0501, $A816;
  583.     (*$END*)
  584. PROCEDURE AEGetSpecialHandler*(functionClass: AEKeyword; VAR handler: Types.UniversalProcPtr; isSysHandler: BOOLEAN): Types.OSErr;
  585.     (*$IF NOT GENERATINGCFM*)
  586.     INLINE PASCAL $303C, $052D, $A816;
  587.     (*$END*)
  588. (**************************************************************************
  589.   This call was added in version 1.0.1. If called with the keyword
  590.   keyAERecorderCount (LONG("recr")), the number of recorders that are
  591.   currently active is returned in 'result'.
  592. **************************************************************************)
  593. (* available only in vers 1.0.1 and greater *)
  594. PROCEDURE AEManagerInfo*(keyWord: AEKeyword; VAR result: LONGINT): Types.OSErr;
  595.     (*$IF NOT GENERATINGCFM*)
  596.     INLINE PASCAL $303C, $0441, $A816;
  597.     (*$END*)
  598.  
  599. (* $ALIGN RESET*)
  600. (* $POP*)
  601.  
  602.  END AppleEvents.
  603.